<?

	$sql = $mysqlclass->mysql_my_query("SHOW TABLES", __LINE__, __FILE__);
	if (mysql_num_rows($sql) > 0) {
		while ($row = mysql_fetch_array($sql, MYSQL_NUM)) $dbs[$row[0]] = $row[0];
	} else $dbs = array();

	if (isset($dbs) && is_array($dbs) && (count($dbs) > 0)){
		foreach($dbs as $key=>$value){
			if ((strlen($setupdata['table_prefix']) == 0) || ((strlen($setupdata['table_prefix']) > 0) && (strpos($key, $setupdata['table_prefix']) === 0))){
				$row = array();
				$sql = $mysqlclass->mysql_my_query("SHOW INDEX FROM `".$key."`", __LINE__, __FILE__);
				if (mysql_num_rows($sql) > 0) {
					while ($r = mysql_fetch_array($sql, MYSQL_NUM)) {
						$row[$r[4]][$r[2]] = $r;
						$tmp = explode("_", $r[2]);
						if (intval($tmp[count($tmp)-1]) > 0){
							$mysqlclass->mysql_my_query("ALTER TABLE `".$key."` DROP INDEX `".$r[2]."`", __LINE__, __FILE__);
						}
					}
					foreach($row as $k=>$v){
						if (is_array($v) && (count($v) > 1)){
							if (isset($v['PRIMARY'][4])) $mysqlclass->mysql_my_query("ALTER TABLE `".$key."` DROP INDEX `".$v['PRIMARY'][4]."`", __LINE__, __FILE__);
						}
					}
				}
			}
		}
	}
?>